package manager;

import java.util.ArrayList;

import models.DTO_MonAn;

public class AppManager {
	public static final int NULL_STATE = -1;
	public static final int ADD_FOOD_NEW_BILL = 0;
	public static final int ADD_FOOD_EXISTING_BILL = 1;

	private ArrayList<DTO_MonAn> foodList;
	private int state;
	private static AppManager instance;

	private AppManager() {
		foodList = new ArrayList<DTO_MonAn>();
	}

	public static synchronized AppManager getInstance() {
		if (instance == null)
			instance = new AppManager();
		return instance;
	}

	public void addFood(DTO_MonAn food) {
		this.foodList.add(food);
	}

	public void clearFoodList() {
		this.foodList.clear();
	}

	@Override
	protected Object clone() throws CloneNotSupportedException {
		throw new CloneNotSupportedException("Clone is not allowed.");
	}

	public ArrayList<DTO_MonAn> getFoodList() {
		return foodList;
	}

	public void setFoodList(ArrayList<DTO_MonAn> foodList) {
		this.foodList = foodList;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

}
